/**
 * 客户投诉接待
 *
 * @Author: 刘国强
 * @Date: 2019/8/7
 */
import axios from '@/api/fetch';
import * as types from './types';
import SERVER from '@/api/server';

// 查询工单选择框
export const searchRepairOrder = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repair/searchCustomerSelect`, { params });

// 查询车辆选择框
export const searchVehicle = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/order/repair/searchVehicleSelect`, { params });

// 新增/保存客户投诉
export const addComplaint = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/complaintReception/btnSave`, params, { mark: types.SAVE });

// 投诉上报ACC
export const sendAccComplaint = params => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/complaintReception/btnSendAcc`, params, { mark: types.SAVE });

// 根据Id查询投诉详情
export const getCompalaintById = complaintId => axios.get(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/complaintReception/getCompalaintByNo/${complaintId}`);

// 根据ID删除跟进明细
export const delComplaintDetailById = Id => axios.delete(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/complaintReception/delComplaintDetailById/${Id}`);

// 根据ID结案
export const closeComplaintById = Id => axios.post(`${SERVER.DMSCLOUD_CUSTOMERREPAIR}/customer/complaintReception/closeComplaintById/${Id}`);

// 查询被投诉部门
export const searchDealerOrg = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/org/getAllSmallOrg`);

// 查询所有员工
export const getDealerUser = params => axios.get(`${SERVER.DMSCLOUD_BASEDATA}/basedata/users/getDealerUser`);

// 查询品牌
export const searchBrand = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/baseData/repair/brandSelect`);

// 查询车系
export const searchSeries = brandsid => axios.get(`${SERVER.DMSCLOUD_REPAIR}/baseData/repair/${brandsid}/seriesSelect`);

// 查询车型
export const searchModel = (brandsid, seriessid) => axios.get(`${SERVER.DMSCLOUD_REPAIR}/baseData/repair/${brandsid}/${seriessid}/modelSelect`);

// 查询配置
export const searchApAckAge = (brandsid, seriessid, modelsid) => axios.get(`${SERVER.BASEDATA}/vehicleProduct/brandsdict/${brandsid}/seriessdict/${seriessid}/modelsdict/${modelsid}/packagesdict`);

// 查询维修类型
export const findAllRepairType = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}/basedataRepairtypes/findAllRepairType`);

// 查询车型
export const getModelList = params => axios.get(`${SERVER.DMSCLOUD_REPAIR}//baseData/basicData/model`);
